package com.pianzhu.blockchainemr.controller;

import com.pianzhu.blockchainemr.pojo.Hospital;
import com.pianzhu.blockchainemr.pojo.MedicalType;
import com.pianzhu.blockchainemr.pojo.result.Result;
import com.pianzhu.blockchainemr.service.HospitalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/hospital")
public class HospitalController {
    @Autowired
    private HospitalService hospitalService;

    @GetMapping("/list")
    public Result hospital() {
        List<Hospital> hospitals = hospitalService.list();
        return Result.success(hospitals);
    }

    @GetMapping("/medicalType")
    public Result medicalType() {
        List<MedicalType> medicalTypes = hospitalService.getMedicalType();
        return Result.success(medicalTypes);
    }
}
